/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package picasagui;

import java.awt.Label;
import java.awt.geom.AffineTransform;
import java.awt.image.*;
import java.io.*;
import java.net.*;
import javax.imageio.*;
import javax.swing.*;
import static javax.swing.JOptionPane.*;

/**
 *
 * @author TranBaoAnh
 */
public class PicasaGUI extends javax.swing.JFrame {

    /**
     * Creates new form PicasaGUI
     */
    private BufferedImage image;
    private JFrame frame;
    private String fileName;
    private JFileChooser dialog = new JFileChooser();
    private int w;
    private int h;
    private double scale = 1.0;
    private AffineTransform aTransform = new AffineTransform();

    public PicasaGUI() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelForm = new javax.swing.JPanel();
        jPanelTreeView = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTreeExplorer = new javax.swing.JTree();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        area = new javax.swing.JLabel();
        jPanelFunction = new javax.swing.JPanel();
        jButtonPrint = new javax.swing.JButton();
        jButtonActualSize = new javax.swing.JButton();
        jButtonZoomIn = new javax.swing.JButton();
        jButtonZoomOut = new javax.swing.JButton();
        jButtonPrevious = new javax.swing.JButton();
        jButtonFullScreen = new javax.swing.JButton();
        jButtonNext = new javax.swing.JButton();
        jButtonRotateLeft = new javax.swing.JButton();
        jButtonRotateRight = new javax.swing.JButton();
        jButtonSendMail = new javax.swing.JButton();
        jButtonDelete = new javax.swing.JButton();
        jMenuBar = new javax.swing.JMenuBar();
        jMenuFile = new javax.swing.JMenu();
        jMenuItemOpen = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Picasa");
        setBackground(new java.awt.Color(192, 192, 192));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setResizable(false);

        jScrollPane1.setViewportView(jTreeExplorer);

        javax.swing.GroupLayout jPanelTreeViewLayout = new javax.swing.GroupLayout(jPanelTreeView);
        jPanelTreeView.setLayout(jPanelTreeViewLayout);
        jPanelTreeViewLayout.setHorizontalGroup(
            jPanelTreeViewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
        );
        jPanelTreeViewLayout.setVerticalGroup(
            jPanelTreeViewLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 660, Short.MAX_VALUE)
        );

        area.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jScrollPane2.setViewportView(area);
        area.getAccessibleContext().setAccessibleName("area");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2)
        );

        jButtonPrint.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Printer.png"))); // NOI18N
        jButtonPrint.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonPrint.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jButtonActualSize.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ActualSize.png"))); // NOI18N
        jButtonActualSize.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonActualSize.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonActualSizeActionPerformed(evt);
            }
        });

        jButtonZoomIn.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomIn.png"))); // NOI18N
        jButtonZoomIn.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonZoomIn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonZoomInActionPerformed(evt);
            }
        });

        jButtonZoomOut.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ZoomOut.png"))); // NOI18N
        jButtonZoomOut.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonZoomOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonZoomOutActionPerformed(evt);
            }
        });

        jButtonPrevious.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Previous.png"))); // NOI18N
        jButtonPrevious.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jButtonFullScreen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/FullScreen.png"))); // NOI18N
        jButtonFullScreen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jButtonNext.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Next.png"))); // NOI18N
        jButtonNext.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jButtonRotateLeft.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RotateLeft.png"))); // NOI18N
        jButtonRotateLeft.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonRotateLeft.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRotateLeftActionPerformed(evt);
            }
        });

        jButtonRotateRight.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RotateRight.png"))); // NOI18N
        jButtonRotateRight.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonRotateRight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonRotateRightActionPerformed(evt);
            }
        });

        jButtonSendMail.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Mail.png"))); // NOI18N
        jButtonSendMail.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        jButtonDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Delete.png"))); // NOI18N
        jButtonDelete.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDeleteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelFunctionLayout = new javax.swing.GroupLayout(jPanelFunction);
        jPanelFunction.setLayout(jPanelFunctionLayout);
        jPanelFunctionLayout.setHorizontalGroup(
            jPanelFunctionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFunctionLayout.createSequentialGroup()
                .addGap(108, 108, 108)
                .addComponent(jButtonPrint, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonActualSize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonZoomIn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonZoomOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonPrevious, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonFullScreen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonNext, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonRotateLeft, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonRotateRight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonSendMail, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(121, 121, 121))
        );
        jPanelFunctionLayout.setVerticalGroup(
            jPanelFunctionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFunctionLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelFunctionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jButtonPrint, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonActualSize, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonZoomIn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonZoomOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonPrevious, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonFullScreen, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonNext, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonRotateLeft, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonRotateRight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonSendMail, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonDelete, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanelFormLayout = new javax.swing.GroupLayout(jPanelForm);
        jPanelForm.setLayout(jPanelFormLayout);
        jPanelFormLayout.setHorizontalGroup(
            jPanelFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelFormLayout.createSequentialGroup()
                .addComponent(jPanelTreeView, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelFunction, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanelFormLayout.setVerticalGroup(
            jPanelFormLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelTreeView, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanelFormLayout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanelFunction, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jMenuFile.setText("File");

        jMenuItemOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItemOpen.setText("Open");
        jMenuItemOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemOpenActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemOpen);

        jMenuBar.add(jMenuFile);

        jMenu2.setText("Edit");
        jMenuBar.add(jMenu2);

        setJMenuBar(jMenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelForm, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelForm, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        setSize(new java.awt.Dimension(1280, 720));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItemOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemOpenActionPerformed
        // TODO add your handling code here:
        if (dialog.showOpenDialog(null) == (JFileChooser.APPROVE_OPTION)) {
            readInFile(dialog.getSelectedFile().getAbsolutePath());
            if (image == null) {
                showMessageDialog(frame, "Does not compute !", "No Image file", INFORMATION_MESSAGE);
            } else {
                setImage(area);
            }
        }
    }//GEN-LAST:event_jMenuItemOpenActionPerformed

    private void jButtonZoomInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonZoomInActionPerformed
        // TODO add your handling code here:
        if (image == null) {
            return;
        }
        scale += (0.05);
        scale = Math.min(10, scale);

        aTransform.setToScale(scale, scale);

        w = (int) (image.getWidth() * scale);
        h = (int) (image.getHeight() * scale);

//        w = (int) (area.getIcon().getIconWidth() * scale);
//        h = (int) (area.getIcon().getIconHeight() * scale);

        ImageIcon temp = new ImageIcon(image.getScaledInstance(w, h, image.SCALE_SMOOTH));
        area.setIcon(temp);
    }//GEN-LAST:event_jButtonZoomInActionPerformed

    private void jButtonZoomOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonZoomOutActionPerformed
        // TODO add your handling code here:
        if (image == null) {
            return;
        }
        scale -= (0.05);
        scale = Math.max(0.01, scale);

        aTransform.setToScale(scale, scale);

        w = (int) (image.getWidth() * scale);
        h = (int) (image.getHeight() * scale);

//        w = (int) (area.getIcon().getIconWidth() * scale);
//        h = (int) (area.getIcon().getIconHeight() * scale);

        ImageIcon temp = new ImageIcon(image.getScaledInstance(w, h, image.SCALE_SMOOTH));
        area.setIcon(temp);
    }//GEN-LAST:event_jButtonZoomOutActionPerformed

    private void jButtonActualSizeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonActualSizeActionPerformed
        // TODO add your handling code here:
        ImageIcon temp = new ImageIcon(image);
        area.setIcon(temp);
    }//GEN-LAST:event_jButtonActualSizeActionPerformed

    private void jButtonRotateLeftActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRotateLeftActionPerformed
        // TODO add your handling code here:
        if (image == null) {
            return;
        }
        w = area.getIcon().getIconWidth();
        h = area.getIcon().getIconHeight();
        AffineTransform at = new AffineTransform();
        at.translate(0, image.getWidth());
        at.rotate(Math.toRadians(270));
        AffineTransformOp op = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        this.image = op.filter(image, null);
        int tmp = w;
        w = h;
        h = tmp;
        ImageIcon temp = new ImageIcon(image.getScaledInstance(w, h, image.SCALE_SMOOTH));
        area.setIcon(temp);
    }//GEN-LAST:event_jButtonRotateLeftActionPerformed

    private void jButtonRotateRightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRotateRightActionPerformed
        // TODO add your handling code here:
        if (image == null) {
            return;
        }
        w = area.getIcon().getIconWidth();
        h = area.getIcon().getIconHeight();
        AffineTransform at = new AffineTransform();
        at.translate(image.getHeight(), 0);
        at.rotate(Math.toRadians(90));
        AffineTransformOp op = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        this.image = op.filter(image, null);
        int tmp = w;
        w = h;
        h = tmp;
        ImageIcon temp = new ImageIcon(image.getScaledInstance(w, h, image.SCALE_SMOOTH));
        area.setIcon(temp);
    }//GEN-LAST:event_jButtonRotateRightActionPerformed

    private void jButtonDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteActionPerformed
        // TODO add your handling code here:
        try{
 
    		File file = new File(fileName);
 
    		if(file.delete()){
    			System.out.println(file.getName() + " is deleted!");
                        area.setIcon(null);
    		}else{
//    			System.out.println("Delete operation is failed.");
                    showMessageDialog(frame, "Can not delete", "Error Delete", ERROR_MESSAGE);
    		}
 
    	}catch(Exception e){
 
    		e.printStackTrace();
 
    	}
    }//GEN-LAST:event_jButtonDeleteActionPerformed

    public void readInFile(String fileName) {
        this.fileName = fileName;
        File file = new File(fileName);
        if (file.isFile()) {
            try {
                image = ImageIO.read(file);
            } catch (IOException e) {
                showMessageDialog(frame, "Does not compute !", "No file read or found", INFORMATION_MESSAGE);
                e.printStackTrace();
            }
        } else {
            URL url = getClass().getResource(fileName);
            if (url == null) {
                try {
                    url = new URL(fileName);
                } catch (MalformedURLException e) {
                    showMessageDialog(frame, "Does not compute !", "No Image file or found", INFORMATION_MESSAGE);
                    e.printStackTrace();
                }
            }
            try {
                image = ImageIO.read(url);
            } catch (IOException e) {
                showMessageDialog(frame, "Does not compute !", "No Image file", WARNING_MESSAGE);
                e.printStackTrace();
            }
        }
    }

    public void setImage(JLabel area) {
        int x = area.getWidth();
        int y = area.getHeight();
        int ix = image.getWidth();
        int iy = image.getHeight();

//        while (ix > x || iy > y) {
//            if (ix > x) {
//                double tiso = (double) (ix - x) / ix;
//                ix = x;
//                iy = iy - (int) (iy * tiso);
//            }
//            if (iy > y) {
//                double tiso = (double) (iy - y) / iy;
//                iy = y;
//                ix = ix - (int) (ix * tiso);
//            }
//        }

        if (ix > x || iy > y) {
            if (((float) x / ix) > ((float) y / iy)) {
                double tiso = (double) y / iy;
                iy = y;
                ix = (int) (tiso * x);
            } else {
                double tiso = (double) x / ix;
                ix = x;
                iy = (int) (tiso * iy);
            }
        }

        ImageIcon temp = new ImageIcon(image.getScaledInstance(ix, iy, image.SCALE_SMOOTH));
        area.setIcon(temp);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new PicasaGUI().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel area;
    private javax.swing.JButton jButtonActualSize;
    private javax.swing.JButton jButtonDelete;
    private javax.swing.JButton jButtonFullScreen;
    private javax.swing.JButton jButtonNext;
    private javax.swing.JButton jButtonPrevious;
    private javax.swing.JButton jButtonPrint;
    private javax.swing.JButton jButtonRotateLeft;
    private javax.swing.JButton jButtonRotateRight;
    private javax.swing.JButton jButtonSendMail;
    private javax.swing.JButton jButtonZoomIn;
    private javax.swing.JButton jButtonZoomOut;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar;
    private javax.swing.JMenu jMenuFile;
    private javax.swing.JMenuItem jMenuItemOpen;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanelForm;
    private javax.swing.JPanel jPanelFunction;
    private javax.swing.JPanel jPanelTreeView;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTree jTreeExplorer;
    // End of variables declaration//GEN-END:variables
}
